/*
 * element.h
 *
 *  Created on: Apr 20, 2011
 *      Author: mariano
 */
#include "array.h"
#include "defs.h"
#ifndef ELEMENT_H_
#define ELEMENT_H_

// Simple string wrapper
typedef struct Element {
	char * name;
} Element;

typedef struct Magic {
	Element * e1;
	Element * e2;
	Element * output;
} Magic;


Element * newElement(char * name);

void deleteElement(Element * e);

Magic * newMagic(Element * e1, Element * e2, Element * output);

void deleteMagic(Magic * m);

int elementCmp(Element * e1,Element * e2);

int isReactor(Magic * magic,Element * reactor);

int isProduct(Magic * magic,Element * reactor);

Element * getMagicProduct(Magic * magic);

Element * getMagicFirstReactor(Magic * magic);

Element * getMagicSecondReactor(Magic * magic);

int elementAlfabeticCmp(Element * e1, Element * e2);

int isTerminal(Element * element, Array * magics);

int isBasic(Element * element, Array * magics);

bool magicCmp(Magic * m1, Magic * m2);

bool pseudoMagicCmp(Magic *m1, Magic *m2);

// Miscellaneous


void printElement(Element * e);


void printMagicOutput(Magic *m);
void printMagic(Magic * m);

#endif /* ELEMENT_H_ */
